<!--
Copyright (C) 2020 Yoann QUERET <yoann@queret.net>
-->

<!--
This file is part of ODR-EncoderManager.

ODR-EncoderManager is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ODR-EncoderManager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ODR-EncoderManager.  If not, see <http://www.gnu.org/licenses/>.
-->


<!DOCTYPE html>
<html lang="en">

{% include 'head.html' %}

<body>
    {% include 'body-nav.html' %}

    <div class="container-fluid">

        <div class="page-header">
            <h1>User management</h1>
        </div>

        <!-- Modal edit -->
        <div class="modal fade" id="InfoModal" role="dialog">
        <div class="modal-dialog modal-lg">
        <div class="modal-content">
        <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Loading ...</h4>
        </div>
        <div class="modal-body">
            <div class="panel panel-primary">
                <div class="panel-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="control-label col-sm-2" for="edit_username">username:</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" id="edit_username" disabled="disabled"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-2" for="edit_password">password:</label>
                            <div class="col-sm-5">
                                <input type="password" class="form-control" id="edit_password" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-2" for="edit_password_confirm"></label>
                            <div class="col-sm-5">
                                <input type="password" class="form-control" id="edit_password_confirm" />
                            </div>
                        </div>
                        <a href="#" class="btn pull-right btn-info" id="btn_user_edit_save"><span class="glyphicon glyphicon-ok"></span> Save</a>
                        <a href="#" class="btn btn-danger" id="btn_user_edit_delete"><span class="glyphicon glyphicon-remove"></span> Delete</a>
                    </form>
                </div>
            </div>
        </div>
        <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
        </div>
        </div>
        </div>

        <!-- Modal add -->
        <div class="modal fade" id="InfoModalAdd" role="dialog">
        <div class="modal-dialog modal-lg">
        <div class="modal-content">
        <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Loading ...</h4>
        </div>
        <div class="modal-body">
            <div class="panel panel-primary">
                <div class="panel-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="control-label col-sm-2" for="add_username">username:</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" id="add_username" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-2" for="add_password">password:</label>
                            <div class="col-sm-5">
                                <input type="password" class="form-control" id="add_password" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-sm-2" for="add_password_confirm"></label>
                            <div class="col-sm-5">
                                <input type="password" class="form-control" id="add_password_confirm" />
                            </div>
                        </div>
                        <a href="#" class="btn pull-right btn-info" id="btn_user_add_save"><span class="glyphicon glyphicon-ok"></span> Save</a>
                    </form>
                </div>
            </div>
        </div>
        <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
        </div>
        </div>
        </div>

        <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/api/restore">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <span class="glyphicon glyphicon-user"></span> <a data-toggle="collapse" data-parent="#accordion" href="#collapseUSER">User</a>
                </h4>
            </div>
            <div id="collapseUSER" class="panel-collapse collapse in">
                <div class="panel-body">
                    <p>Choose the user whose password you want to change or that you want to delete.</p>
                    <ul class="list-group" id="user-list"></ul>
                </div>
            </div>
        </div>
        </form>

        <div>
            <a href="#" class="btn btn-info" id="btn_user_add" data-toggle="modal" data-target="#InfoModalAdd"><span class="glyphicon glyphicon-plus-sign"></span> Add a new user</a>
        </div>

    </div>

</body>

</html>
